﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>

        $(function () {

            wx.config({
                debug: false,//调试模式   当为tru时，开启调试模式
                appId: "",
                timestamp: timestamp.toString(),//签名时间戳
                nonceStr: nonceStr, //生成签名的随机串
                signature: signature,//签名
                jsApiList: ['chooseImage', 'uploadImage', 'getLocalImgData', 'downloadImage'],
                success: function () {
                    alert("配置成功")
                },
                fail: function () {
                    alert("配置失败")
                }
            });
            aaa();
            function aaa() {
                $.ajax({
                    url: 'wx_getConfig',
                    type: 'get',
                    dataType: 'json',
                    async: false,
                    success: function (data) {
                        var appId = data[0].appId;
                        var timestamp = data[0].timestamp;
                        var nonceStr = data[0].nonceStr;
                        var signature = data[0].signature;
                       
                    },
                    error: function () {
                        alert("error");
                    }
                })
            }
        });
    </script>
</head>
<body>
    <div> 
    </div>
</body>
</html>
